package com.dzl.exchange.service;

import com.dzl.base.service.BaseService;
import com.dzl.exchange.pojo.WelfareExchange;
import com.dzl.exchange.pojo.dto.ExchangeMealGoodsDto;
import com.dzl.exchange.pojo.query.ExchangeGroupQuery;
import com.dzl.exchange.pojo.vo.ExchangeGroupVo;
import com.dzl.exchange.pojo.vo.ExchangeMealGoodsVo;
import com.dzl.exchange.pojo.vo.ExchangeSkuGoodsVo;
import com.dzl.goods.pojo.vo.WelfareGoodsSupplierPreviewVo;
import com.github.pagehelper.PageInfo;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 兑换券组表(WelfareExchangeSecretGroup)表服务接口
 * @author caobucao
 * @date 2021-07-09 17:26:05
 */
public interface WelfareExchangeService extends BaseService<WelfareExchange> {

    /**
     * 分页查询兑换券组列表
     * @date 2021/7/9 17:38
     * @author caobucao
     * @param query  查询条件
     * @return java.util.List<com.dzl.card.pojo.vo.WelfareCardVo>
     */
    PageInfo<ExchangeGroupVo> selectExchangeGroupVoListPage(ExchangeGroupQuery query);

    /**
     * 修改兑换券商品展示价
     * @param type 1兑换券套餐商品 2兑换券商品
     * @param exchangeGoodsId 兑换券商品表主键id
     * @param displayPrice 兑换券商品展示价格
     * @author liuguanjun
     * @date 2021/12/06 11:04
     */
    Integer updateExchangeGoodsDisplayPrice(Integer type, Integer exchangeGoodsId, BigDecimal displayPrice);

    /**
     * 订单商品预览，以供应商维度
     * @param type 1兑换券商品 2兑换券套餐
     * @param  itemIds 选中的套餐或商品id
     * @author liuguanjun
     * @date 2021-12-08 09:38:54
     **/
    WelfareGoodsSupplierPreviewVo getOrderItemsPreview(Integer type, String itemIds);

    /**
     * 保存兑换券
     * @date 2021/7/9 19:26
     * @author caobucao
     * @param group 兑换券组对象
     * @return java.lang.Integer
     */
    Integer saveExchangeGroup(WelfareExchange group);

    /**
     * 获取兑换券关联的套餐及套餐下的SKU及商品----兑换券管理套餐回显专用
     * @date 2021/7/10 19:48
     * @author caobucao
     * @param exchangeId 兑换券id
     * @return com.dzl.util.JsonResult<java.util.List<com.dzl.exchange.pojo.vo.ExchangeMealGoodsVo>>
     */
    List<ExchangeMealGoodsVo> getExchangeMealCheckedSkuAndGoods(Integer exchangeId);

    /**
     * 根据套餐id获取兑换券选商品规则下的选中的sku及商品
     * @param mealId 兑换券套餐id
     * @author liuguanjun
     * @date 2021/12/10 11:09
     */
    List<ExchangeSkuGoodsVo> getExchangeMealCheckedSkuAndGoodsByMealId(Integer mealId);

    /**
     * 获取兑换券选商品规则下的选中的sku及商品 --- 分页
     * @date 2021/7/13 20:35
     * @author caobucao
     * @param exchangeId 兑换券id
     * @return java.util.List<com.dzl.exchange.pojo.vo.ExchangeGoodsSkuVo>
     */
    List<ExchangeSkuGoodsVo> getExchangeSkuAndGoods(Integer exchangeId);

    /**
     * 更改兑换券套餐
     * @date 2021/7/26 10:47
     * @author caobucao
     * @param dto
     * @return java.util.Map<java.lang.String,java.lang.Object>
     */
    Map<String, Object> addMealGoodsAndSku(ExchangeMealGoodsDto dto);
}
